<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="description" content="" />
		<meta name="keywords" content="" />
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<!-- 禁用电话号码检测功能，禁止对数字随便可以拨号 -->
		<meta name="format-detection" content="telephone=no">
		<!-- 禁用地址检测功能，禁止跳转到地图 -->
		<meta name="format-detection" content="address=no">
		<!-- 在苹果设备上以全屏方式打开本网页 -->
		<meta name="apple-mobile-web-app-capable" content="yes">
		<!-- 设置在苹果设备上状态的颜色，默认白色，要设置成什么颜色以Web颜色的风格而定 -->
		<meta name="apple-mobile-web-app-status-bar-style" content="white">
		<title>微信商城-结算</title>
		<%@ include file="/views/common/required.jspf"%>
		<!-- 苹果设备在桌面上生成的快捷图标 -->
		<link rel="apple-touch-icon" href="img/apple-touch-icon.png">
		<link rel="icon" href="img/favicon.ico">
	</head>
	
	<body>
		<header class="header-wrapper">
			<ul class="header-list">
				<li>
					<a href="${ctx }/product/listProduct.html">
						<i class="fa fa-2x fa-home"></i>
						<p>首页</p>
					</a>
				</li>
				<li class="list-active">
					<a href="${ctx}/product/listStoreCart.html">
						<i class="fa fa-2x fa-shopping-cart"></i>
						<p>购物车</p>
					</a>
				</li>
				<li>
					<a href="${ctx }/user/userInfo.html">
						<i class="fa fa-2x fa-user"></i>
						<p>用户中心</p>
					</a>
				</li>
			</ul>
		</header>
		<section style="width: 100%; height: .6rem;"></section>
		
		<form action="${ctx }/order/addOrder.html" method="post" id="orderForm">
		<section class="shopping-address">
			<a href="address.html">管理收货地址</a>
		</section>
		<input type="hidden" name="storeOrder.sys_user_id" value="${user.id }"/>
		<section class="orderlist-main">
			<div class="main-goods">
				<h3>收货人地址</h3>
				<div class="goods-form">
				  <div class="form-new-address" style="display:block">
					    	<div class="address-inner">
					    		<span>收货人姓名:</span><br />
					    		<input type="text" class="input"  name="storeOrder.receiver" value="${receiveAddress.receiver}" readonly />
					    		<span>所在地区：</span><br />
					    		<select name="storeOrder.province" style="width: 1.3rem;height: .4rem;" readonly>
					    			<option value="${receiveAddress.province}" selected>${receiveAddress.province}</option>
					    		</select>&nbsp;&nbsp;
					    		<select name="storeOrder.city" style="width: 1.3rem;height: .4rem;"readonly>
					    			<option value="${receiveAddress.city}" selected>${receiveAddress.city}</option>
					    		</select>&nbsp;&nbsp;
					    		<select name="storeOrder.area" style="width: 1.3rem;height: .4rem;"readonly>
					    		<option value="${receiveAddress.area}" selected>${receiveAddress.area}</option>
					    		</select><br />
					    		<span>详细地址:</span><br />
					    		<input type="text" class="input" value="${receiveAddress.address}" name="storeOrder.address" readonly/><br />
					    		<span>手机号码:</span><br />
					    		<input type="text" name="storeOrder.phone"class="input" value="${receiveAddress.phone }" readonly/><br />
					    	</div>
					    </div>
				</div>
			</div>
			<div class="main-goods">
				<h3>发票信息</h3>
				<div class="goods-form">
		    			<div class="form-invoice">
		    				<div class="invoice-inner" >
		    					<span>发票类型：</span><br />
		    					<select name="storeOrder.ticket" class="inner-type">
		    						<option value="1">普通发票</option>
		    						<option value="2">增值税发票</option>
		    					</select><br />
		    					<span>发票抬头：</span><br />
		    					<select name="" class="inner-title">
		    						<option value="">个人</option>
		    						<option value="">单位</option>
		    					</select>
		    					<input type="text"/>
		    				</div>
		    			</div>
				</div>
			</div>
			
			<div class="main-goods-list">
				<h3>商品清单</h3>
				<table class="table table-bordered">
					<tr>
						<th>商品名称</th>
						<th>数量</th>
						<th>小计</th>
					</tr>
					<c:set var="total" value="0"></c:set>
					<c:set var="orderProductId"  value=","></c:set>
					<c:forEach items="${orderProductList }" var="orderProduct" >
					<tr>
					<td>${orderProduct.name}</td>
					<td>${orderProduct.count}</td>
					<td>${orderProduct.count * orderProduct.price}</td>
					 <c:set var="total" value="${total+orderProduct.count * orderProduct.price }"></c:set>
					 <c:set var="orderProductId" value="${orderProduct.id}${orderProductId }"></c:set>
					</tr>
					</c:forEach>
				</table>
			</div>
			<input type="hidden" name="storeOrder.store_order_product_id" value="${orderProductId}"/>
			<div class="main-message">
				<h3>给卖家留言</h3>
				<input type="text" id="message-input" name="storeOrder.msg"/>
			</div>
		</section>
        
       <section style="width: 100%;height: .5rem;"></section>
        <footer class="orderlist-footer">
        	<div class="footer-left">
        		<span class="left-price">总价： <span>￥${total }</span></span>
        		<input type="hidden" name="storeOrder.total" value="${total }"/>
        	</div>
        	<div class="footer-right">
        		<a href="#" onclick="submit()">提交订单</a>
        	</div>
        </footer>
        </form>
	<script>
	function submit(){
		$("#orderForm").submit();
	}
	</script>
	</body>
</html>
